#ifndef __WK2XXX_OPTS_H__
#define __WK2XXX_OPTS_H__

#include <linux/spi/spi.h>
int wk2xxx_read_global_reg(struct spi_device *spi, uint8_t reg, uint8_t *dat);
int wk2xxx_write_global_reg(struct spi_device *spi, uint8_t reg, uint8_t dat);
int wk2xxx_read_slave_reg(struct spi_device *spi, uint8_t port, uint8_t reg, uint8_t *dat);
int wk2xxx_write_slave_reg(struct spi_device *spi, uint8_t port, uint8_t reg, uint8_t dat);
int wk2xxx_read_fifo(struct spi_device *spi, uint8_t port, uint8_t fifolen, uint8_t *dat);
int wk2xxx_write_fifo(struct spi_device *spi, uint8_t port, uint8_t fifolen, uint8_t *dat);


int wk2xxx_enable_rx(struct spi_device *spi,uint8_t port);
int wk2xxx_enable_tx(struct spi_device *spi,uint8_t port);
int wk2xxx_enable_tx_trig(struct spi_device *spi,uint8_t port);
int wk2xxx_disable_rx(struct spi_device *spi,uint8_t port);
int wk2xxx_disable_tx(struct spi_device *spi,uint8_t port);
int wk2xxx_disable_tx_trig(struct spi_device *spi,uint8_t port);

int wk2xxx_get_rx_fifo_used(struct spi_device *spi,uint8_t port);
int wk2xxx_get_tx_fifo_cap(struct spi_device *spi,uint8_t port);
uint8_t wk2xxx_get_glob_int_flag(struct spi_device *spi);
uint8_t wk2xxx_get_int_flag(struct spi_device *spi, uint8_t port);
int wk2xxx_set_baudrate(struct spi_device *spi,uint port,int baudrate);
int wk2xxx_get_baudrate(struct spi_device *spi, uint8_t port);
int wk2xxx_port_init(struct spi_device *spi,uint8_t port);
int wk2xxx_port_deinit(struct spi_device *spi,uint8_t port);

#define WK2XXX_TX_RIGGER_SIZE   (128)
#define WK2XXX_GLOB_REG_DUMP_SIZE  (4)
#define WK2XXX_CHANNEL_REG_DUMP_SIZE  (9)
// data size 4
int wk2xxx_dump_glob_regs(struct spi_device *spi,uint8_t *data);
// data size 9
int wk2xxx_dump_channel_regs(struct spi_device *spi,uint8_t port , uint8_t *data);

#endif /* __WK2XXX_OPTS_H__ */